const sequelize  =require('../db/sequelize')
const dbConnection = async ()=>{
    return new Promise(async (resove,reject)=>{
        try {  
            await sequelize.authenticate()
            console.log(`myql connect success on ${process.env.DB_PORT}`)
            resove()
        } catch (error) {
            console.log(`myql connect fail on ${process.env.DB_PORT}`, error);
            reject(error)
        }
    })
}

module.exports = dbConnection